package com.ruoyi.common.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author DRIES
 */
public class CommonUtils {

    public static <T> List<T> objToList(Object obj, Class<T> clazz) {
        List<T> list = new ArrayList<>();
        if (obj instanceof ArrayList<?>) {
            ((ArrayList<?>) obj).forEach(o -> {
                list.add(clazz.cast(o));
            });

            return list;
        }

        return null;
    }

}
